<?php

class edu_news extends Controller {

	function edu_news()
	{
		parent::Controller();	
	}
	
	function index()
	{
		$this->load->model('filemanagementmodel');
		$this->load->model('NewsModel');
	    $data['header_tel'] = $this->filemanagementmodel->getByPostion('header_tel');
	    $data['footer_address'] = $this->filemanagementmodel->getByPostion('footer_add1');
		
	    $this->load->library('pagination');

	    $per_page = 10;
   		$total = $this->NewsModel->count_all();
   		$data['news'] = $this->NewsModel->getNews($per_page, $this->uri->segment(3));
	    
   
   		$base_url = site_url('edu_news/index/');
	    $config['base_url'] = $base_url;
	    $config['total_rows'] = $total;
	    $config['per_page'] = $per_page;
	    $config['uri_segment'] = '3';
	
	    $this->pagination->initialize($config); 
		
		$data['paging'] = str_replace('index.html/', 'index/', $this->pagination->create_links());
	    
		$this->load->view('f_header', $data);
		$this->load->view('f_edu_news', $data);
		$this->load->view('f_footer', $data);
	}
	
	
}

?>